package com.group02.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.group02.community.entity.user.SysRole;
import com.group02.community.entity.vo.queryVO.RoleQueryVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper extends BaseMapper<SysRole> {

    /**
     * 根据用户id查询用户权限
     * @param userId
     * @return
     */
    List<SysRole> selectRolesByUserId(Long userId);


    /**
     * 获取全部的角色
     * @return
     */
    IPage<SysRole> selectAllRole(IPage<SysRole> page, @Param("rq") RoleQueryVO rq);
}
